package org.lq.shopping.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 商品类型实体类
 * @author 张平平
 * @时间  2018年9月26日
 */
public class ShopGoodstype implements Serializable {
	/**
	 * 版本序列号
	 */
	private static final long serialVersionUID = -3551182213958761642L;
	
	private int goodstype_id;//商品类型ID
	private String goodstype_name;//商品类型名称
	private int parent_id;//商品类型父级ID
	
	private List<ShopGoodstype> childs = new ArrayList<>();
	public List<ShopGoodstype> getChilds() {
		return childs;
	}
	public void setChilds(List<ShopGoodstype> childs) {
		this.childs = childs;
	}
	public ShopGoodstype() {
		super();
	}
	public ShopGoodstype(int goodstype_id, String goodstype_name, int parent_id) {
		super();
		this.goodstype_id = goodstype_id;
		this.goodstype_name = goodstype_name;
		this.parent_id = parent_id;
	}
	public int getGoodstype_id() {
		return goodstype_id;
	}
	public void setGoodstype_id(int goodstype_id) {
		this.goodstype_id = goodstype_id;
	}
	public String getGoodstype_name() {
		return goodstype_name;
	}
	public void setGoodstype_name(String goodstype_name) {
		this.goodstype_name = goodstype_name;
	}
	public int getParent_id() {
		return parent_id;
	}
	public void setParent_id(int parent_id) {
		this.parent_id = parent_id;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + goodstype_id;
		result = prime * result + ((goodstype_name == null) ? 0 : goodstype_name.hashCode());
		result = prime * result + parent_id;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ShopGoodstype other = (ShopGoodstype) obj;
		if (goodstype_id != other.goodstype_id)
			return false;
		if (goodstype_name == null) {
			if (other.goodstype_name != null)
				return false;
		} else if (!goodstype_name.equals(other.goodstype_name))
			return false;
		if (parent_id != other.parent_id)
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "ShopGoodstype [goodstype_id=" + goodstype_id + ", goodstype_name=" + goodstype_name + ", parent_id="
				+ parent_id + "]";
	}
}
